<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      * {
        margin: 0;
        padding: 0;
      }
      .box {
        position: relative;
        width: 200px;
        height: 200px;
        margin: 100px auto;
        perspective: 800px;
      }
      .box div {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        text-align: center;
        line-height: 200px;
        font-size: 20px;
        color: #fff;
        font-weight: bold;
        border-radius: 50%;
        /* 过渡 */
        transition: all 1s;
        transform-style: preserve-3d;
      }
      .one {
        background-color: pink;
        z-index: 1;
        /* 只要这个盒子背景朝着我们 将其隐藏 */
        backface-visibility: hidden;
      }
      .two {
        background-color: skyblue;
        /* 先沿着Y轴旋转180deg */
        transform: rotateY(180deg);
      }
      /* 鼠标放在.box盒子上面 让里面的两个盒子进行翻转 */
      .box:hover .one {
        transform: rotateY(180deg);
      }
      .box:hover .two {
        transform: rotateY(0deg);
      }
    </style>
  </head>
  <body>
    <div class="box">
      <div class="one">黑马程序员</div>
      <div class="two">前端60期</div>
    </div>
  </body>
</html>
